/*
 * file: test01.v
 * 
 * Combined instructions test
 */

module cucu;

integer a, b, c;

initial begin
  a = 0;
  c = 1;
  while(a < 2) begin
    for(b = 0; b < 2; b = b + 1)
      $display("a = %d  b = %d", a, b);
    a = a +1;
  end
  
  if (a < b)
     if (a < c)
        $display("a < b, a < c");
     else
        $display("a < b, c <= a");
  else
     if (a < c)
        $display("a >= b, a < c");
     else
        $display("a >= b, c <= a");

  fork
  //branch I
    begin
      for(a = 0; a < 3; a = a+1)
        $display("a = %d", a);
    end
  //branch II
    begin
      for(b = 0; b < 3; b = b+1)
        $display("b = %d", b);
    end
  //branch III
    for(a = 0; a < 3; a = a+1)
      $display("a = %d", a);
  join
end
endmodule
